/**
 *Create By kxx
 * 铅笔的基类
 */
import {Sprite} from "../base/Sprite.js";
import {Director} from "../Director.js";

export class Pencil extends Sprite {
    // top:图片底部与canvas顶部的距离
    constructor(image, top) {
        super(image,
            0, 0,
            image.width, image.height,
            window.innerWidth, 0,
            image.width, image.height);
        this.top = top;
    }

    draw() {
        this.x = this.x - Director.getInstance().landSpeed;
        super.draw(this.img,
            0, 0,
            this.img.width, this.img.height,
            this.x, this.y,
            this.img.width, this.img.height);
    }
}